package com.szrt.day20170427;


import java.lang.annotation.Annotation;

import org.junit.Test;

public class XueSanDuoTest {
	
	
	/**
	 * 注解的测试
	 * @throws Exception
	 */
	@Test
	public void annotiotion01() throws Exception {
		
		//1  拿到照妖镜   照完之后 clazz保存：这个类上有没有注解  类有多少个属性  类上面有多少个方法  构造方法
		Class<?> clazz = Class.forName("com.szrt.day20170427.XueSanDuo");
		
		Annotation[] annotations = clazz.getAnnotations();
		
		
		System.out.println(annotations.length);
		
		for(Annotation annotation : annotations){
			
			LiangGua liangGua = (LiangGua) annotation;
			
			System.out.println(liangGua.getAge());
			System.out.println(liangGua.getName());
		}
		
		
	}

}
